#set(String title = "最新主题")
#tag layout_block("bodyContent")
<div class="columns">
    <div class="column home-topic">
        <div class="message is-light">
            <div class="message-header">
                <span class="has-text-left"><span class="icon is-small"><i class="fa fa-fire"></i></span> 最新主题</span>
            </div>
            <div class="message-body has-text-centered">
                #for(topic : topicPage.rows)
                <article class="media">
                    <figure class="media-left">
                        <p class="image is-48x48">
                            <a href="${siteUrl('/@' + topic.username)}">
                                <img class="avatar-48" src="${topic.avatar}">
                            </a>
                        </p>
                    </figure>
                    <div class="media-content">
                        <div class="content">
                            <p class="topic-title">
                                <a href="${siteUrl('/topic/' + topic.tid)}">${topic.title}</a>
                            </p>
                            <p class="topic-meta">
                                <a class="topic-meta" href="${siteUrl('/node/' + topic.nodeSlug)}">${topic.nodeTitle}</a>
                                <span> • </span>
                                <a class="topic-meta" href="${siteUrl('/@' + topic.username)}">${topic.username}</a>
                                <span> • </span>
                                <small>发布于12分钟前</small>
                                <span> • </span>
                                #if(topic.comments > 0)
                                <small>最后回复来自</small>
                                <a class="topic-meta" href="${siteUrl('/@' + topic.replyUser)}">${topic.replyUser}</a>
                                #else
                                <small>暂无回复</small>
                                #end
                            </p>
                        </div>
                    </div>
                    <div class="media-right" style="line-height: 55px;">
                        <a href="${siteUrl('/topic/' + topic.tid + '#reply-' + topic.replyId)}">
                            <span class="tag is-rounded" style="background-color: #aab0c6">${topic.comments}</span>
                        </a>
                    </div>
                </article>
                #end
            </div>
            <div class="message-header">
                <nav class="pagination">
                    #if(topicPage.hasPrevPage)
                    <a class="pagination-previous" href="${siteUrl('/topics/' + topicPage.prevPage)}">上一页</a>
                    #end
                    #if(topicPage.hasNextPage)
                    <a class="pagination-next" href="${siteUrl('/topics/' + topicPage.nextPage)}">下一页</a>
                    #end
                </nav>
            </div>
        </div>
    </div>
    #include('partials/sidebar.html')
</div>

#end
#include('layouts/default.html')